package com.yh.patterns.state.job;

/**
 * @Author:云尚
 * @Description:骨灰级状态类
 */
public class FinalState extends State{
    public FinalState(State professionalState) {
        this.rankName="骨灰级";
        this.player=professionalState.player;
        this.point=professionalState.point;
    }
    public void doubleScore(){
        System.out.println(rankName+"玩家"+player.getName()+"使用积分翻倍+20");
        point+=20;
        checkState(point);
    }
    public void changeCards(){
        System.out.println(rankName+"玩家"+player.getName()+"换牌");
    }
    public void peekCards(){
        System.out.println(rankName+"玩家"+player.getName()+"偷看牌");
    }
    @Override
    public void checkState(int point) {
        if(point<60){
            player.setState(new ProfessionalState(this));
        }
    }
}
